package service.impl;

import java.util.List;
import java.util.UUID;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import dao.CustomerDao;
import pojo.Customer;
import service.CustomerService;

@Component(value="service")
public class CustomerServiceImpl implements CustomerService{
	
	@Resource(name="customerdao")
	private CustomerDao cd;

	@Override
	public Customer addCustomer(Customer c) {
		c.setId(UUID.randomUUID().toString());
		return cd.addCustomer(c);
	}

	@Override
	public Customer updateCustomer(Customer c) {
		return cd.updateCustomer(c);
	}

	@Override
	public List<Customer> findAllCustomers() {
		List<Customer> list=cd.findAllCustomers();
		return list;
	}

	@Override
	public String deleteCustomer(String id) {		
		return cd.deleteCustomer(id);
	}

}
